package com.atlyn.test;

import com.atlyn.bean.Teacher;
import com.atlyn.utils.Tool;
import org.junit.Test;


public class test1 {
private Tool tool = new Tool();
//向教师信息插入一条记录
public void addTeacher(Teacher t){
    String sql = "insert into teacher(tid,tname,course,level,tpwd)values(?,?,?,?,?)";
    int insertCount = tool.update(sql,t.getTid(),t.getTname(),t.getCourse(),t.getLevel(),t.getTpwd());
    if (insertCount > 0){
        System.out.println(t.getTname() + "成功录入！");
    }else {
        System.out.println("录入失败！");
    }
}
@Test
    public void play1(){
    Teacher t = new Teacher(2,"李华","政治","一级教师","lh123456");
    addTeacher(t);
}
}
